Lint Report

Check performed at Tue Feb 18 22:27:49 CST 2014.
3460 errors and 1740 warnings found:

Correctness
6Error ResAuto: Hardcoded Package in Namespace
4Error MissingRegistered: Missing registered class
14Warning ScrollViewSize: ScrollView size validation
4Warning DefaultLocale: Implied default locale in case conversion
2Warning InconsistentLayout: Inconsistent Layouts
554Warning InlinedApi: Using inlined constants on older versions
3446Error NewApi: Calling new methods on older versions
2Warning OldTargetApi: Target SDK attribute is not targeting latest version
2Warning ShowToast: Toast created but not shown
2Error ValidFragment: Fragment not instantiatable
2Error WrongCall: Using wrong draw/layout method
2Warning ExtraText: Extraneous text in resource files
26Warning SpUsage: Using dp instead of sp for text sizes
14Warning Deprecated: Using deprecated resources
Correctness:Messages
10Warning Typos: Spelling error
Security
2Warning TrulyRandom: Weak RNG
6Warning ExportedContentProvider: Content provider does not require permission
2Warning ExportedReceiver: Receiver does not require permission
2Warning ExportedService: Exported service does not require permission
4Warning WorldReadableFiles: openFileOutput() call passing MODE_WORLD_READABLE
2Warning AllowBackup: Missing allowBackup attribute
Performance
28Warning DrawAllocation: Memory allocations within drawing code
2Warning Recycle: Missing recycle() calls
2Warning ObsoleteLayoutParam: Obsolete layout params
8Warning UseCompoundDrawables: Node can be replaced by a TextView with compound drawables
16Warning HandlerLeak: Handler reference leaks
20Warning MergeRootFrame: FrameLayout can be replaced with <merge> tag
2Warning UseSparseArrays: HashMap can be replaced with SparseArray
10Warning DisableBaselineAlignment: Missing baselineAligned attribute
82Warning InefficientWeight: Inefficient layout weight
8Warning NestedWeights: Nested layout weights
18Warning Overdraw: Overdraw: Painting regions more than once
132Warning UnusedResources: Unused resources
16Warning UselessParent: Useless parent layout
Usability:Typography
18Warning TypographyEllipsis: Ellipsis string can be replaced with ellipsis character
Usability:Icons
4Warning GifUsage: Using .gif format for bitmaps is discouraged
84Warning IconLocation: Image defined in density-independent drawable folder
6Warning IconDensities: Icon densities validation
6Warning IconDuplicates: Duplicated icons under different names
Usability
2Warning ButtonOrder: Button order
80Warning TextFields: Missing inputType or hint
2Warning AlwaysShowAction: Usage of showAsAction=always
2Warning ViewConstructor: Missing View constructors for XML inflation
4Warning ButtonCase: Cancel/OK dialog button capitalization
Accessibility
108Warning ContentDescription: Image without contentDescription
Internationalization
432Warning HardcodedText: Hardcoded text
Disabled Checks (11)

Correctness
ResAuto: Hardcoded Package in Namespace
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/custom_layout.xml:22: In Gradle projects, always use http://schemas.android.com/apk/res-auto for custom attributes
  19 
  20 <com.example.android.apis.view.CustomLayout
  21         xmlns:android="http://schemas.android.com/apk/res/android"
  22         xmlns:app="http://schemas.android.com/apk/res/com.example.android.apis"
  23         android:layout_width="match_parent"
  24         android:layout_height="match_parent">
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/custom_layout.xml:22: In Gradle projects, always use http://schemas.android.com/apk/res-auto for custom attributes
  19 
  20 <com.example.android.apis.view.CustomLayout
  21         xmlns:android="http://schemas.android.com/apk/res/android"
  22         xmlns:app="http://schemas.android.com/apk/res/com.example.android.apis"
  23         android:layout_width="match_parent"
  24         android:layout_height="match_parent">
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/custom_view_1.xml:20: In Gradle projects, always use http://schemas.android.com/apk/res-auto for custom attributes
  17 <!-- Demonstrates defining custom views in a layout file. -->
  18 
  19 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  20         xmlns:app="http://schemas.android.com/apk/res/com.example.android.apis"
  21         android:orientation="vertical"
  22         android:layout_width="match_parent"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/custom_view_1.xml:20: In Gradle projects, always use http://schemas.android.com/apk/res-auto for custom attributes
  17 <!-- Demonstrates defining custom views in a layout file. -->
  18 
  19 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  20         xmlns:app="http://schemas.android.com/apk/res/com.example.android.apis"
  21         android:orientation="vertical"
  22         android:layout_width="match_parent"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/drag_layout.xml:20: In Gradle projects, always use http://schemas.android.com/apk/res-auto for custom attributes
  17 <!-- Layout description of the DragAndDrop sample's main activity -->
  18 
  19 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  20     xmlns:dot="http://schemas.android.com/apk/res/com.example.android.apis"
  21     android:layout_width="match_parent"
  22     android:layout_height="wrap_content"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/drag_layout.xml:20: In Gradle projects, always use http://schemas.android.com/apk/res-auto for custom attributes
  17 <!-- Layout description of the DragAndDrop sample's main activity -->
  18 
  19 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  20     xmlns:dot="http://schemas.android.com/apk/res/com.example.android.apis"
  21     android:layout_width="match_parent"
  22     android:layout_height="wrap_content"
Priority: 9 / 10
Category: Correctness
Severity: Error
Explanation: Finds resource namespaces with hardcoded package names.
In Gradle projects, the actual package used in the final APK can vary; for you can add a .debug package suffix in one version and not the other. Therefore, you should not hardcode the application package in the resource; instead, use the special namespace http://schemas.android.com/apk/res-auto which will cause the tools to figure out the right namespace for the resource regardless of the actual package used during the build.

More info:

To suppress this error, use the issue id "ResAuto" as explained in the Suppressing Warnings and Errors section.
MissingRegistered: Missing registered class
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/AndroidManifest.xml:998: Class referenced in the manifest, com.example.android.apis.app.PrintBitmap, was not found in the project or the libraries
 995             </intent-filter>
 996         </activity>
 997 
 998         <activity android:name=".app.PrintBitmap"
 999                 android:label="@string/print_bitmap"
1000                 android:enabled="@bool/atLeastKitKat">
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/AndroidManifest.xml:998: Class referenced in the manifest, com.example.android.apis.app.PrintBitmap, was not found in the project or the libraries
 995             </intent-filter>
 996         </activity>
 997 
 998         <activity android:name=".app.PrintBitmap"
 999                 android:label="@string/print_bitmap"
1000                 android:enabled="@bool/atLeastKitKat">
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/mapview.xml:24: Class referenced in the layout file, com.google.android.maps.MapView, was not found in the project or the libraries
  21     android:id="@+id/main"
  22     android:layout_width="match_parent" 
  23     android:layout_height="match_parent">
  24     <com.google.android.maps.MapView
  25         android:layout_width="match_parent" 
  26         android:layout_height="match_parent"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/mapview.xml:24: Class referenced in the layout file, com.google.android.maps.MapView, was not found in the project or the libraries
  21     android:id="@+id/main"
  22     android:layout_width="match_parent" 
  23     android:layout_height="match_parent">
  24     <com.google.android.maps.MapView
  25         android:layout_width="match_parent" 
  26         android:layout_height="match_parent"
Priority: 8 / 10
Category: Correctness
Severity: Error
Explanation: Ensures that classes referenced in the manifest are present in the project or libraries.
If a class is referenced in the manifest, it must also exist in the project (or in one of the libraries included by the project. This check helps uncover typos in registration names, or attempts to rename or move classes without updating the manifest file properly.

More info: http://developer.android.com/guide/topics/manifest/manifest-intro.html

To suppress this error, use the issue id "MissingRegistered" as explained in the Suppressing Warnings and Errors section.
ScrollViewSize: ScrollView size validation
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/action_bar_display_options.xml:20: This LinearLayout should use android:layout_height="wrap_content"
  17               android:layout_width="match_parent"
  18               android:layout_height="match_parent">
  19     <LinearLayout android:layout_width="match_parent"
  20                   android:layout_height="match_parent"
  21                   android:orientation="vertical">
  22         <Button android:id="@+id/toggle_home_as_up"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/action_bar_display_options.xml:20: This LinearLayout should use android:layout_height="wrap_content"
  17               android:layout_width="match_parent"
  18               android:layout_height="match_parent">
  19     <LinearLayout android:layout_width="match_parent"
  20                   android:layout_height="match_parent"
  21                   android:orientation="vertical">
  22         <Button android:id="@+id/toggle_home_as_up"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/alert_dialog.xml:24: This LinearLayout should use android:layout_height="wrap_content"
  21     android:layout_width="match_parent" android:layout_height="match_parent"
  22     android:orientation="vertical">
  23     <LinearLayout
  24         android:layout_width="match_parent" android:layout_height="match_parent"
  25         android:orientation="vertical">
  26         <Button android:id="@+id/two_buttons"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/alert_dialog.xml:24: This LinearLayout should use android:layout_height="wrap_content"
  21     android:layout_width="match_parent" android:layout_height="match_parent"
  22     android:orientation="vertical">
  23     <LinearLayout
  24         android:layout_width="match_parent" android:layout_height="match_parent"
  25         android:orientation="vertical">
  26         <Button android:id="@+id/two_buttons"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/image_view_1.xml:23: This LinearLayout should use android:layout_height="wrap_content"
  20     
  21     <LinearLayout
  22         android:layout_width="match_parent"
  23         android:layout_height="match_parent"
  24         android:orientation="vertical">
  25         
Note: This issue has an associated quickfix operation in Eclipse/ADT Fix
Priority: 7 / 10
Category: Correctness
Severity: Warning
Explanation: Checks that ScrollViews use wrap_content in the scrolling dimension.
ScrollView children must set their layout_width or layout_height attributes to wrap_content rather than fill_parent or match_parent in the scrolling dimension

More info:

To suppress this error, use the issue id "ScrollViewSize" as explained in the Suppressing Warnings and Errors section.
DefaultLocale: Implied default locale in case conversion
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/view/SystemUIModes.java:165: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead
 162 
 163     private String getDisplaySize() {
 164         DisplayMetrics dm = getResources().getDisplayMetrics();
 165         return String.format("DisplayMetrics = (%d x %d)", dm.widthPixels, dm.heightPixels);
 166     }
 167     private String getViewSize() {
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/view/SystemUIModes.java:165: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead
 162 
 163     private String getDisplaySize() {
 164         DisplayMetrics dm = getResources().getDisplayMetrics();
 165         return String.format("DisplayMetrics = (%d x %d)", dm.widthPixels, dm.heightPixels);
 166     }
 167     private String getViewSize() {
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/view/SystemUIModes.java:168: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead
 165         return String.format("DisplayMetrics = (%d x %d)", dm.widthPixels, dm.heightPixels);
 166     }
 167     private String getViewSize() {
 168         return String.format("View = (%d,%d - %d,%d)",
 169                 mImage.getLeft(), mImage.getTop(),
 170                 mImage.getRight(), mImage.getBottom());
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/view/SystemUIModes.java:168: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead
 165         return String.format("DisplayMetrics = (%d x %d)", dm.widthPixels, dm.heightPixels);
 166     }
 167     private String getViewSize() {
 168         return String.format("View = (%d,%d - %d,%d)",
 169                 mImage.getLeft(), mImage.getTop(),
 170                 mImage.getRight(), mImage.getBottom());
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Finds calls to locale-ambiguous String manipulation methods.
Calling String#toLowerCase() or #toUpperCase() without specifying an explicit locale is a common source of bugs. The reason for that is that those methods will use the current locale on the user's device, and even though the code appears to work correctly when you are developing the app, it will fail in some locales. For example, in the Turkish locale, the uppercase replacement for i is not I.

If you want the methods to just perform ASCII replacement, for example to convert an enum name, call String#toUpperCase(Locale.US) instead. If you really want to use the current locale, call String#toUpperCase(Locale.getDefault()) instead.

More info: http://developer.android.com/reference/java/util/Locale.html#default_locale

To suppress this error, use the issue id "DefaultLocale" as explained in the Suppressing Warnings and Errors section.
InconsistentLayout: Inconsistent Layouts
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout-land/fragment_layout.xml:29: The id "details" in layout "fragment_layout" is missing from the following layout configurations: layout (present in layout-land)
  26             android:id="@+id/titles" android:layout_weight="1"
  27             android:layout_width="0px" android:layout_height="match_parent" />
  28 
  29     <FrameLayout android:id="@+id/details" android:layout_weight="1"
  30             android:layout_width="0px" android:layout_height="match_parent"
  31             android:background="?android:attr/detailsElementBackground" />
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout-land/fragment_layout.xml:29: The id "details" in layout "fragment_layout" is missing from the following layout configurations: layout (present in layout-land)
  26             android:id="@+id/titles" android:layout_weight="1"
  27             android:layout_width="0px" android:layout_height="match_parent" />
  28 
  29     <FrameLayout android:id="@+id/details" android:layout_weight="1"
  30             android:layout_width="0px" android:layout_height="match_parent"
  31             android:background="?android:attr/detailsElementBackground" />
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Checks that layout variations are consistent.
This check ensures that a layout resource which is defined in multiple resource folders, specifies the same set of widgets.

This finds cases where you have accidentally forgotten to add a widget to all variations of the layout, which could result in a runtime crash for some resource configurations when a findViewById() fails.

There are cases where this is intentional. For example, you may have a dedicated large tablet layout which adds some extra widgets that are not present in the phone version of the layout. As long as the code accessing the layout resource is careful to handle this properly, it is valid. In that case, you can suppress this lint check for the given extra or missing views, or the whole layout

More info:

To suppress this error, use the issue id "InconsistentLayout" as explained in the Suppressing Warnings and Errors section.
InlinedApi: Using inlined constants on older versions
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/ActionBarDisplayOptions.java:99: Field requires API level 14 (current min is 7): android.view.Gravity#RELATIVE_HORIZONTAL_GRAVITY_MASK
  96             case R.id.cycle_custom_gravity:
  97                 ActionBar.LayoutParams lp = (ActionBar.LayoutParams) mCustomView.getLayoutParams();
  98                 int newGravity = 0;
  99                 switch (lp.gravity & Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK) {
 100                     case Gravity.START:
 101                         newGravity = Gravity.CENTER_HORIZONTAL;
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/ActionBarDisplayOptions.java:99: Field requires API level 14 (current min is 7): android.view.Gravity#RELATIVE_HORIZONTAL_GRAVITY_MASK
  96             case R.id.cycle_custom_gravity:
  97                 ActionBar.LayoutParams lp = (ActionBar.LayoutParams) mCustomView.getLayoutParams();
  98                 int newGravity = 0;
  99                 switch (lp.gravity & Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK) {
 100                     case Gravity.START:
 101                         newGravity = Gravity.CENTER_HORIZONTAL;
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/ActionBarDisplayOptions.java:104: Field requires API level 14 (current min is 7): android.view.Gravity#END
 101                         newGravity = Gravity.CENTER_HORIZONTAL;
 102                         break;
 103                     case Gravity.CENTER_HORIZONTAL:
 104                         newGravity = Gravity.END;
 105                         break;
 106                     case Gravity.END:
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/ActionBarDisplayOptions.java:104: Field requires API level 14 (current min is 7): android.view.Gravity#END
 101                         newGravity = Gravity.CENTER_HORIZONTAL;
 102                         break;
 103                     case Gravity.CENTER_HORIZONTAL:
 104                         newGravity = Gravity.END;
 105                         break;
 106                     case Gravity.END:
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/ActionBarDisplayOptions.java:107: Field requires API level 14 (current min is 7): android.view.Gravity#START
 104                         newGravity = Gravity.END;
 105                         break;
 106                     case Gravity.END:
 107                         newGravity = Gravity.START;
 108                         break;
 109                 }
Note: This issue has an associated quickfix operation in Eclipse/ADT Fix
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Finds inlined fields that may or may not work on older platforms.
This check scans through all the Android API field references in the application and flags certain constants, such as static final integers and Strings, which were introduced in later versions. These will actually be copied into the class files rather than being referenced, which means that the value is available even when running on older devices. In some cases that's fine, and in other cases it can result in a runtime crash or incorrect behavior. It depends on the context, so consider the code carefully and device whether it's safe and can be suppressed or whether the code needs tbe guarded.

If you really want to use this API and don't need to support older devices just set the minSdkVersion in your AndroidManifest.xml file.
If your code is deliberately accessing newer APIs, and you have ensured (e.g. with conditional execution) that this code will only ever be called on a supported platform, then you can annotate your class or method with the @TargetApi annotation specifying the local minimum SDK to apply, such as @TargetApi(11), such that this check considers 11 rather than your manifest file's minimum SDK as the required API level.

More info:

To suppress this error, use the issue id "InlinedApi" as explained in the Suppressing Warnings and Errors section.
NewApi: Calling new methods on older versions
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/ActionBarDisplayOptions.java:121: Call requires API level 11 (current min is 7): android.view.View#getSystemUiVisibility
 118                 }
 119                 return;
 120             case R.id.toggle_system_ui:
 121                 if ((getWindow().getDecorView().getSystemUiVisibility()
 122                         & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0) {
 123                     getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/ActionBarDisplayOptions.java:121: Call requires API level 11 (current min is 7): android.view.View#getSystemUiVisibility
 118                 }
 119                 return;
 120             case R.id.toggle_system_ui:
 121                 if ((getWindow().getDecorView().getSystemUiVisibility()
 122                         & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0) {
 123                     getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/ActionBarDisplayOptions.java:123: Call requires API level 11 (current min is 7): android.view.View#setSystemUiVisibility
 120             case R.id.toggle_system_ui:
 121                 if ((getWindow().getDecorView().getSystemUiVisibility()
 122                         & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0) {
 123                     getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
 124                 } else {
 125                     getWindow().getDecorView().setSystemUiVisibility(
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/ActionBarDisplayOptions.java:123: Call requires API level 11 (current min is 7): android.view.View#setSystemUiVisibility
 120             case R.id.toggle_system_ui:
 121                 if ((getWindow().getDecorView().getSystemUiVisibility()
 122                         & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0) {
 123                     getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
 124                 } else {
 125                     getWindow().getDecorView().setSystemUiVisibility(
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/ActionBarDisplayOptions.java:125: Call requires API level 11 (current min is 7): android.view.View#setSystemUiVisibility
 122                         & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0) {
 123                     getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
 124                 } else {
 125                     getWindow().getDecorView().setSystemUiVisibility(
 126                             View.SYSTEM_UI_FLAG_FULLSCREEN);
 127                 }
Note: This issue has an associated quickfix operation in Eclipse/ADT Fix
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Finds API accesses to APIs that are not supported in all targeted API versions.
This check scans through all the Android API calls in the application and warns about any calls that are not available on all versions targeted by this application (according to its minimum SDK attribute in the manifest).

If you really want to use this API and don't need to support older devices just set the minSdkVersion in your AndroidManifest.xml file.
If your code is deliberately accessing newer APIs, and you have ensured (e.g. with conditional execution) that this code will only ever be called on a supported platform, then you can annotate your class or method with the @TargetApi annotation specifying the local minimum SDK to apply, such as @TargetApi(11), such that this check considers 11 rather than your manifest file's minimum SDK as the required API level.

If you are deliberately setting android: attributes in style definitions, make sure you place this in a values-v11 folder in order to avoid running into runtime conflicts on certain devices where manufacturers have added custom attributes whose ids conflict with the new ones on later platforms.

Similarly, you can use tools:targetApi="11" in an XML file to indicate that the element will only be inflated in an adequate context.

More info:

To suppress this error, use the issue id "NewApi" as explained in the Suppressing Warnings and Errors section.
OldTargetApi: Target SDK attribute is not targeting latest version
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/AndroidManifest.xml:40: Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details.
  37     <!-- For android.media.audiofx.Visualizer -->
  38     <uses-permission android:name="android.permission.RECORD_AUDIO" />
  39 
  40     <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="17" />
  41 
  42     <!-- We will request access to the camera, saying we require a camera
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/AndroidManifest.xml:40: Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details.
  37     <!-- For android.media.audiofx.Visualizer -->
  38     <uses-permission android:name="android.permission.RECORD_AUDIO" />
  39 
  40     <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="17" />
  41 
  42     <!-- We will request access to the camera, saying we require a camera
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Checks that the manifest specifies a targetSdkVersion that is recent.
When your application runs on a version of Android that is more recent than your targetSdkVersion specifies that it has been tested with, various compatibility modes kick in. This ensures that your application continues to work, but it may look out of place. For example, if the targetSdkVersion is less than 14, your app may get an option button in the UI.

To fix this issue, set the targetSdkVersion to the highest available value. Then test your app to make sure everything works correctly. You may want to consult the compatibility notes to see what changes apply to each version you are adding support for: http://developer.android.com/reference/android/os/Build.VERSION_CODES.html

More info: http://developer.android.com/reference/android/os/Build.VERSION_CODES.html

To suppress this error, use the issue id "OldTargetApi" as explained in the Suppressing Warnings and Errors section.
ShowToast: Toast created but not shown
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/VoiceRecognition.java:227: Expected duration Toast.LENGTH_SHORT or Toast.LENGTH_LONG, a custom duration value is not supported
 224         }
 225 
 226         private void showToast(String text) {
 227             Toast.makeText(VoiceRecognition.this, text, 1000).show();
 228         }
 229     }
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/VoiceRecognition.java:227: Expected duration Toast.LENGTH_SHORT or Toast.LENGTH_LONG, a custom duration value is not supported
 224         }
 225 
 226         private void showToast(String text) {
 227             Toast.makeText(VoiceRecognition.this, text, 1000).show();
 228         }
 229     }
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Looks for code creating a Toast but forgetting to call show() on it.
Toast.makeText() creates a Toast but does not show it. You must call show() on the resulting object to actually make the Toast appear.

More info:

To suppress this error, use the issue id "ShowToast" as explained in the Suppressing Warnings and Errors section.
ValidFragment: Fragment not instantiatable
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/ActionBarTabs.java:113: This fragment class should be public (com.example.android.apis.app.ActionBarTabs.TabContentFragment)
 110     private class TabContentFragment extends Fragment {
 111         private String mText;
 112 
 113         public TabContentFragment(String text) {
 114             mText = text;
 115         }
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/ActionBarTabs.java:113: This fragment class should be public (com.example.android.apis.app.ActionBarTabs.TabContentFragment)
 110     private class TabContentFragment extends Fragment {
 111         private String mText;
 112 
 113         public TabContentFragment(String text) {
 114             mText = text;
 115         }
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Ensures that Fragment subclasses can be instantiated.
From the Fragment documentation:
Every fragment must have an empty constructor, so it can be instantiated when restoring its activity's state. It is strongly recommended that subclasses do not have other constructors with parameters, since these constructors will not be called when the fragment is re-instantiated; instead, arguments can be supplied by the caller with setArguments(Bundle) and later retrieved by the Fragment with getArguments().

More info: http://developer.android.com/reference/android/app/Fragment.html#Fragment()

To suppress this error, use the issue id "ValidFragment" as explained in the Suppressing Warnings and Errors section.
WrongCall: Using wrong draw/layout method
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/PrintHtmlOffScreen.java:109: Suspicious method call; should probably call "layout" rather than "onLayout"
 106             public void onLayout(PrintAttributes oldAttributes, PrintAttributes newAttributes,
 107                     CancellationSignal cancellationSignal, LayoutResultCallback callback,
 108                     Bundle extras) {
 109                 mWrappedInstance.onLayout(oldAttributes, newAttributes, cancellationSignal,
 110                         callback, extras);
 111             }
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/PrintHtmlOffScreen.java:109: Suspicious method call; should probably call "layout" rather than "onLayout"
 106             public void onLayout(PrintAttributes oldAttributes, PrintAttributes newAttributes,
 107                     CancellationSignal cancellationSignal, LayoutResultCallback callback,
 108                     Bundle extras) {
 109                 mWrappedInstance.onLayout(oldAttributes, newAttributes, cancellationSignal,
 110                         callback, extras);
 111             }
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Finds cases where the wrong call is made, such as calling onMeasure instead of measure
Custom views typically need to call measure() on their children, not onMeasure. Ditto for onDraw, onLayout, etc.

More info:

To suppress this error, use the issue id "WrongCall" as explained in the Suppressing Warnings and Errors section.
ExtraText: Extraneous text in resource files
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/trigger_sensors.xml:31: Unexpected text found in layout file: "/>"
  28         android:layout_weight="1"
  29         android:scrollbars="vertical"/>
  30      />
  31 </LinearLayout>
  32 

/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/trigger_sensors.xml:31: Unexpected text found in layout file: "/>"
  28         android:layout_weight="1"
  29         android:scrollbars="vertical"/>
  30      />
  31 </LinearLayout>
  32 

Priority: 3 / 10
Category: Correctness
Severity: Warning
Explanation: Looks for extraneous text in resource files.
Layout resource files should only contain elements and attributes. Any XML text content found in the file is likely accidental (and potentially dangerous if the text resembles XML and the developer believes the text to be functional)

More info:

To suppress this error, use the issue id "ExtraText" as explained in the Suppressing Warnings and Errors section.
SpUsage: Using dp instead of sp for text sizes
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/custom_view_1.xml:35: Should use "sp" instead of "dp" for text sizes
  32             android:background="@drawable/blue"
  33             android:layout_width="match_parent"
  34             android:layout_height="wrap_content" 
  35             app:text="Blue" app:textSize="20dp"/>
  36     
  37     <com.example.android.apis.view.LabelView
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/custom_view_1.xml:35: Should use "sp" instead of "dp" for text sizes
  32             android:background="@drawable/blue"
  33             android:layout_width="match_parent"
  34             android:layout_height="wrap_content" 
  35             app:text="Blue" app:textSize="20dp"/>
  36     
  37     <com.example.android.apis.view.LabelView
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/game.xml:44: Should use "sp" instead of "dp" for text sizes
  41             android:layout_width="wrap_content"
  42             android:layout_height="wrap_content"
  43             android:layout_gravity="top|right"
  44             android:textSize="28dp"
  45             />
  46     </FrameLayout>
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/game.xml:44: Should use "sp" instead of "dp" for text sizes
  41             android:layout_width="wrap_content"
  42             android:layout_height="wrap_content"
  43             android:layout_gravity="top|right"
  44             android:textSize="28dp"
  45             />
  46     </FrameLayout>
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/grid_layout_2.xml:28: Should use "sp" instead of "dp" for text sizes
  25     >
  26     <TextView
  27         android:text="Email setup"
  28         android:textSize="32dip"
  29         android:layout_columnSpan="4"
  30         android:layout_gravity="center_horizontal"
Priority: 3 / 10
Category: Correctness
Severity: Warning
Explanation: Looks for uses of dp instead of sp dimensions for text sizes.
When setting text sizes, you should normally use sp, or "scale-independent pixels". This is like the dp unit, but it is also scaled by the user's font size preference. It is recommend you use this unit when specifying font sizes, so they will be adjusted for both the screen density and the user's preference.

There are cases where you might need to use dp; typically this happens when the text is in a container with a specific dp-size. This will prevent the text from spilling outside the container. Note however that this means that the user's font size settings are not respected, so consider adjusting the layout itself to be more flexible.

More info: http://developer.android.com/training/multiscreen/screendensities.html

To suppress this error, use the issue id "SpUsage" as explained in the Suppressing Warnings and Errors section.
Deprecated: Using deprecated resources
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/alert_dialog_text_entry.xml:39: android:autoText is deprecated: Use inputType instead
  36         android:layout_marginLeft="20dip"
  37         android:layout_marginRight="20dip"
  38         android:scrollHorizontally="true"
  39         android:autoText="false"
  40         android:capitalize="none"
  41         android:gravity="fill_horizontal"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/alert_dialog_text_entry.xml:39: android:autoText is deprecated: Use inputType instead
  36         android:layout_marginLeft="20dip"
  37         android:layout_marginRight="20dip"
  38         android:scrollHorizontally="true"
  39         android:autoText="false"
  40         android:capitalize="none"
  41         android:gravity="fill_horizontal"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/alert_dialog_text_entry.xml:40: android:capitalize is deprecated: Use inputType instead
  37         android:layout_marginRight="20dip"
  38         android:scrollHorizontally="true"
  39         android:autoText="false"
  40         android:capitalize="none"
  41         android:gravity="fill_horizontal"
  42         android:textAppearance="?android:attr/textAppearanceMedium" />
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/alert_dialog_text_entry.xml:40: android:capitalize is deprecated: Use inputType instead
  37         android:layout_marginRight="20dip"
  38         android:scrollHorizontally="true"
  39         android:autoText="false"
  40         android:capitalize="none"
  41         android:gravity="fill_horizontal"
  42         android:textAppearance="?android:attr/textAppearanceMedium" />
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/alert_dialog_text_entry.xml:61: android:autoText is deprecated: Use inputType instead
  58         android:layout_marginLeft="20dip"
  59         android:layout_marginRight="20dip"
  60         android:scrollHorizontally="true"
  61         android:autoText="false"
  62         android:capitalize="none"
  63         android:gravity="fill_horizontal"
Priority: 2 / 10
Category: Correctness
Severity: Warning
Explanation: Looks for usages of deprecated layouts, attributes, and so on.
Deprecated views, attributes and so on are deprecated because there is a better way to do something. Do it that new way. You've been warned.

More info:

To suppress this error, use the issue id "Deprecated" as explained in the Suppressing Warnings and Errors section.
Correctness:Messages
Typos: Spelling error
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/values/strings.xml:507: "ok" is usually capitalized as "OK"
 504     <string name="status_bar_notifications_ok">:-|</string>
 505     <string name="status_bar_notifications_sad">:-(</string>
 506     <string name="status_bar_notifications_happy_message">I am happy</string>
 507     <string name="status_bar_notifications_ok_message">I am ok</string>
 508     <string name="status_bar_notifications_sad_message">I am sad</string>
 509     <string name="status_bar_notifications_clear">Clear notification</string>
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/values/strings.xml:507: "ok" is usually capitalized as "OK"
 504     <string name="status_bar_notifications_ok">:-|</string>
 505     <string name="status_bar_notifications_sad">:-(</string>
 506     <string name="status_bar_notifications_happy_message">I am happy</string>
 507     <string name="status_bar_notifications_ok_message">I am ok</string>
 508     <string name="status_bar_notifications_sad_message">I am sad</string>
 509     <string name="status_bar_notifications_clear">Clear notification</string>
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/values/strings.xml:1033: Repeated word "nom" in message: possible typo
1030     <string name="hover_message_moved_at">Moved within the container at (%1$f,%2$f).</string>
1031     <string name="hover_message_exited_at">Exited the container at (%1$f,%2$f).  The pointer may be inside the bounds of a child instead.</string>
1032     <string name="hover_intercept_message_initial">Try hovering over the button.</string>
1033     <string name="hover_intercept_message_intercepted">Intercepted hover event instead of sending it to the button.  Om nom nom!</string>
1034     <string name="hover_button">Hover Here</string>
1035 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/values/strings.xml:1033: Repeated word "nom" in message: possible typo
1030     <string name="hover_message_moved_at">Moved within the container at (%1$f,%2$f).</string>
1031     <string name="hover_message_exited_at">Exited the container at (%1$f,%2$f).  The pointer may be inside the bounds of a child instead.</string>
1032     <string name="hover_intercept_message_initial">Try hovering over the button.</string>
1033     <string name="hover_intercept_message_intercepted">Intercepted hover event instead of sending it to the button.  Om nom nom!</string>
1034     <string name="hover_button">Hover Here</string>
1035 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/values/strings.xml:1121: "Ok" is usually capitalized as "OK"
1118     <string name="focus_5_button5">5</string>
1119     <string name="gallery_2_text">Testing</string>
1120     <string name="grid_layout_1_instructions">Type here:</string>
1121     <string name="grid_layout_1_ok">Ok</string>
1122     <string name="grid_layout_1_cancel">Cancel</string>
1123     <string name="googlelogin_login">Login</string>
Note: This issue has an associated quickfix operation in Eclipse/ADT Fix
Priority: 7 / 10
Category: Correctness:Messages
Severity: Warning
Explanation: Looks for typos in messages.
This check looks through the string definitions, and if it finds any words that look like likely misspellings, they are flagged.

More info:

To suppress this error, use the issue id "Typos" as explained in the Suppressing Warnings and Errors section.
Security
TrulyRandom: Weak RNG
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/security/KeyStoreUsage.java:316: Potentially insecure random numbers on Android 4.3 and older. Read https://android-developers.blogspot.com/2013/08/some-securerandom-thoughts.html for more info.
 313                 cal.add(Calendar.YEAR, 1);
 314                 Date end = cal.getTime();
 315 
 316                 KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", "AndroidKeyStore");
 317                 kpg.initialize(new KeyPairGeneratorSpec.Builder(getApplicationContext())
 318                         .setAlias(alias)
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/security/KeyStoreUsage.java:316: Potentially insecure random numbers on Android 4.3 and older. Read https://android-developers.blogspot.com/2013/08/some-securerandom-thoughts.html for more info.
 313                 cal.add(Calendar.YEAR, 1);
 314                 Date end = cal.getTime();
 315 
 316                 KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", "AndroidKeyStore");
 317                 kpg.initialize(new KeyPairGeneratorSpec.Builder(getApplicationContext())
 318                         .setAlias(alias)
Priority: 9 / 10
Category: Security
Severity: Warning
Explanation: Looks for calls to JCA primitives that may be affected by SecureRandom vulnerability.
Key generation, signing, encryption, and random number generation may not receive cryptographically strong values due to improper initialization of the underlying PRNG on Android 4.3 and below.

If your application relies on cryptographically secure random number generation you should apply the workaround described in https://android-developers.blogspot.com/2013/08/some-securerandom-thoughts.html .

This lint rule is mostly informational; it does not accurately detect whether cryptographically secure RNG is required, or whether the workaround has already been applied. After reading the blog entry and updating your code if necessary, you can disable this lint issue.

More info: https://android-developers.blogspot.com/2013/08/some-securerandom-thoughts.html

To suppress this error, use the issue id "TrulyRandom" as explained in the Suppressing Warnings and Errors section.
ExportedContentProvider: Content provider does not require permission
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/AndroidManifest.xml:486: Exported content providers can provide access to potentially sensitive data
 483                 <category android:name="android.intent.category.SAMPLE_CODE" />
 484             </intent-filter>
 485         </activity>
 486         <provider android:name=".app.LoaderThrottle$SimpleProvider"
 487                   android:authorities="com.example.android.apis.app.LoaderThrottle"
 488                   android:enabled="@bool/atLeastHoneycomb" />
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/AndroidManifest.xml:486: Exported content providers can provide access to potentially sensitive data
 483                 <category android:name="android.intent.category.SAMPLE_CODE" />
 484             </intent-filter>
 485         </activity>
 486         <provider android:name=".app.LoaderThrottle$SimpleProvider"
 487                   android:authorities="com.example.android.apis.app.LoaderThrottle"
 488                   android:enabled="@bool/atLeastHoneycomb" />
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/AndroidManifest.xml:842: Exported content providers can provide access to potentially sensitive data
 839         <!-- This provider declaration informs the Search Manager that you have a provider of -->
 840         <!-- Search suggestions, and provides information about how to access it. -->
 841 
 842         <provider android:name=".app.SearchSuggestionSampleProvider"
 843                   android:authorities="com.example.android.apis.SuggestionProvider" />
 844 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/AndroidManifest.xml:842: Exported content providers can provide access to potentially sensitive data
 839         <!-- This provider declaration informs the Search Manager that you have a provider of -->
 840         <!-- Search suggestions, and provides information about how to access it. -->
 841 
 842         <provider android:name=".app.SearchSuggestionSampleProvider"
 843                   android:authorities="com.example.android.apis.SuggestionProvider" />
 844 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/AndroidManifest.xml:1234: Exported content providers can provide access to potentially sensitive data
1231             </intent-filter>
1232         </activity>
1233 
1234         <provider android:name=".content.FileProvider"
1235                   android:authorities="com.example.android.apis.content.FileProvider"
1236                   android:enabled="@bool/atLeastHoneycombMR2" />
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/AndroidManifest.xml:1234: Exported content providers can provide access to potentially sensitive data
1231             </intent-filter>
1232         </activity>
1233 
1234         <provider android:name=".content.FileProvider"
1235                   android:authorities="com.example.android.apis.content.FileProvider"
1236                   android:enabled="@bool/atLeastHoneycombMR2" />
Priority: 5 / 10
Category: Security
Severity: Warning
Explanation: Checks for exported content providers that do not require permissions.
Content providers are exported by default and any application on the system can potentially use them to read and write data. If the content provider provides access to sensitive data, it should be protected by specifying export=false in the manifest or by protecting it with a permission that can be granted to other applications.

More info:

To suppress this error, use the issue id "ExportedContentProvider" as explained in the Suppressing Warnings and Errors section.
ExportedReceiver: Receiver does not require permission
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/AndroidManifest.xml:649: Exported receiver does not require permission
 646 
 647         <!-- Stub for memory testing. -->
 648 
 649         <receiver android:name=".app.DoNothing"
 650                 android:process=":empty" android:exported="true" />
 651 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/AndroidManifest.xml:649: Exported receiver does not require permission
 646 
 647         <!-- Stub for memory testing. -->
 648 
 649         <receiver android:name=".app.DoNothing"
 650                 android:process=":empty" android:exported="true" />
 651 
Priority: 5 / 10
Category: Security
Severity: Warning
Explanation: Checks for exported receivers that do not require permissions.
Exported receivers (receivers which either set exported=true or contain an intent-filter and do not specify exported=false) should define a permission that an entity must have in order to launch the receiver or bind to it. Without this, any application can use this receiver.

More info:

To suppress this error, use the issue id "ExportedReceiver" as explained in the Suppressing Warnings and Errors section.
ExportedService: Exported service does not require permission
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/AndroidManifest.xml:551: Exported service does not require permission
 548             </intent-filter>
 549         </activity>
 550 
 551         <service android:name=".app.RemoteService" android:process=":remote">
 552             <intent-filter>
 553                 <!-- These are the interfaces supported by the service, which
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/AndroidManifest.xml:551: Exported service does not require permission
 548             </intent-filter>
 549         </activity>
 550 
 551         <service android:name=".app.RemoteService" android:process=":remote">
 552             <intent-filter>
 553                 <!-- These are the interfaces supported by the service, which
Note: This issue has an associated quickfix operation in Eclipse/ADT Fix
Priority: 5 / 10
Category: Security
Severity: Warning
Explanation: Checks for exported services that do not require permissions.
Exported services (services which either set exported=true or contain an intent-filter and do not specify exported=false) should define a permission that an entity must have in order to launch the service or bind to it. Without this, any application can use this service.

More info:

To suppress this error, use the issue id "ExportedService" as explained in the Suppressing Warnings and Errors section.
WorldReadableFiles: openFileOutput() call passing MODE_WORLD_READABLE
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/ActionBarShareActionProviderActivity.java:100: Using MODE_WORLD_READABLE when creating files can be risky, review carefully
  97         try {
  98             inputStream = getResources().openRawResource(R.raw.robot);
  99             outputStream = openFileOutput(SHARED_FILE_NAME,
 100                     Context.MODE_WORLD_READABLE | Context.MODE_APPEND);
 101             byte[] buffer = new byte[1024];
 102             int length = 0;
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/ActionBarShareActionProviderActivity.java:100: Using MODE_WORLD_READABLE when creating files can be risky, review carefully
  97         try {
  98             inputStream = getResources().openRawResource(R.raw.robot);
  99             outputStream = openFileOutput(SHARED_FILE_NAME,
 100                     Context.MODE_WORLD_READABLE | Context.MODE_APPEND);
 101             byte[] buffer = new byte[1024];
 102             int length = 0;
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/content/InstallApk.java:155: Using MODE_WORLD_READABLE when creating files can be risky, review carefully
 152         FileOutputStream fout = null;
 153         try {
 154             is = getAssets().open(assetName);
 155             fout = openFileOutput("tmp.apk", Context.MODE_WORLD_READABLE);
 156             int n;
 157             while ((n=is.read(buffer)) >= 0) {
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/content/InstallApk.java:155: Using MODE_WORLD_READABLE when creating files can be risky, review carefully
 152         FileOutputStream fout = null;
 153         try {
 154             is = getAssets().open(assetName);
 155             fout = openFileOutput("tmp.apk", Context.MODE_WORLD_READABLE);
 156             int n;
 157             while ((n=is.read(buffer)) >= 0) {
Priority: 4 / 10
Category: Security
Severity: Warning
Explanation: Checks for openFileOutput() and getSharedPreferences() calls passing MODE_WORLD_READABLE
There are cases where it is appropriate for an application to write world readable files, but these should be reviewed carefully to ensure that they contain no private data that is leaked to other applications.

More info:

To suppress this error, use the issue id "WorldReadableFiles" as explained in the Suppressing Warnings and Errors section.
AllowBackup: Missing allowBackup attribute
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/AndroidManifest.xml:48: Should explicitly set android:allowBackup to true or false (it's true by default, and that can have some security implications for the application's data)
  45     <uses-feature android:name="android.hardware.camera" />
  46     <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
  47 
  48     <application android:name="ApiDemosApplication"
  49             android:label="@string/activity_sample_code"
  50             android:icon="@drawable/app_sample_code"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/AndroidManifest.xml:48: Should explicitly set android:allowBackup to true or false (it's true by default, and that can have some security implications for the application's data)
  45     <uses-feature android:name="android.hardware.camera" />
  46     <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
  47 
  48     <application android:name="ApiDemosApplication"
  49             android:label="@string/activity_sample_code"
  50             android:icon="@drawable/app_sample_code"
Note: This issue has an associated quickfix operation in Eclipse/ADT Fix
Priority: 3 / 10
Category: Security
Severity: Warning
Explanation: Ensure that allowBackup is explicitly set in the application's manifest.
The allowBackup attribute determines if an application's data can be backed up and restored. It is documented at http://developer.android.com/reference/android/R.attr.html#allowBackup

By default, this flag is set to true. When this flag is set to true, application data can be backed up and restored by the user using adb backup and adb restore.

This may have security consequences for an application. adb backup allows users who have enabled USB debugging to copy application data off of the device. Once backed up, all application data can be read by the user. adb restore allows creation of application data from a source specified by the user. Following a restore, applications should not assume that the data, file permissions, and directory permissions were created by the application itself.

Setting allowBackup="false" opts an application out of both backup and restore.

To fix this warning, decide whether your application should support backup, and explicitly set android:allowBackup=(true|false)"

More info: http://developer.android.com/reference/android/R.attr.html#allowBackup

To suppress this error, use the issue id "AllowBackup" as explained in the Suppressing Warnings and Errors section.
Performance
DrawAllocation: Memory allocations within drawing code
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/graphics/AlphaBitmap.java:78: Avoid object allocations during draw/layout operations (preallocate and reuse instead)
  75         @Override protected void onDraw(Canvas canvas) {
  76             canvas.drawColor(Color.WHITE);
  77 
  78             Paint p = new Paint();
  79             float y = 10;
  80 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/graphics/AlphaBitmap.java:78: Avoid object allocations during draw/layout operations (preallocate and reuse instead)
  75         @Override protected void onDraw(Canvas canvas) {
  76             canvas.drawColor(Color.WHITE);
  77 
  78             Paint p = new Paint();
  79             float y = 10;
  80 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/graphics/BitmapDecode.java:117: Avoid object allocations during draw/layout operations (preallocate and reuse instead)
 114         protected void onDraw(Canvas canvas) {
 115             canvas.drawColor(0xFFCCCCCC);
 116 
 117             Paint p = new Paint();
 118             p.setAntiAlias(true);
 119 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/graphics/BitmapDecode.java:117: Avoid object allocations during draw/layout operations (preallocate and reuse instead)
 114         protected void onDraw(Canvas canvas) {
 115             canvas.drawColor(0xFFCCCCCC);
 116 
 117             Paint p = new Paint();
 118             p.setAntiAlias(true);
 119 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/graphics/ColorFilters.java:152: Avoid object allocations during draw/layout operations (preallocate and reuse instead)
 149                 if (color == 0) {
 150                     filter = null;
 151                 } else {
 152                     filter = new PorterDuffColorFilter(color,
 153                                                        mModes[mModeIndex]);
 154                 }
Priority: 9 / 10
Category: Performance
Severity: Warning
Explanation: Looks for memory allocations within drawing code.
You should avoid allocating objects during a drawing or layout operation. These are called frequently, so a smooth UI can be interrupted by garbage collection pauses caused by the object allocations.

The way this is generally handled is to allocate the needed objects up front and to reuse them for each drawing operation.

Some methods allocate memory on your behalf (such as Bitmap.create), and these should be handled in the same way.

More info:

To suppress this error, use the issue id "DrawAllocation" as explained in the Suppressing Warnings and Errors section.
Recycle: Missing recycle() calls
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/view/DraggableDot.java:107: This TypedArray should be recycled after use with #recycle()
 104         mGlow.setStyle(Paint.Style.STROKE);
 105 
 106         // look up any layout-defined attributes
 107         TypedArray a = context.obtainStyledAttributes(attrs,
 108                 R.styleable.DraggableDot);
 109 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/view/DraggableDot.java:107: This TypedArray should be recycled after use with #recycle()
 104         mGlow.setStyle(Paint.Style.STROKE);
 105 
 106         // look up any layout-defined attributes
 107         TypedArray a = context.obtainStyledAttributes(attrs,
 108                 R.styleable.DraggableDot);
 109 
Priority: 7 / 10
Category: Performance
Severity: Warning
Explanation: Looks for missing recycle() calls on resources.
Many resources, such as TypedArrays, VelocityTrackers, etc., should be recycled (with a recycle() call) after use. This lint check looks for missing recycle() calls.

More info:

To suppress this error, use the issue id "Recycle" as explained in the Suppressing Warnings and Errors section.
ObsoleteLayoutParam: Obsolete layout params
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/drag_layout.xml:88: Invalid layout param in a RelativeLayout: layout_weight
  85     <TextView android:id="@+id/drag_text"
  86         android:layout_width="fill_parent"
  87         android:layout_height="fill_parent"
  88         android:layout_weight="1"
  89         android:layout_below="@id/drag_dot_3"
  90         android:layout_alignLeft="@id/drag_dot_3"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/drag_layout.xml:88: Invalid layout param in a RelativeLayout: layout_weight
  85     <TextView android:id="@+id/drag_text"
  86         android:layout_width="fill_parent"
  87         android:layout_height="fill_parent"
  88         android:layout_weight="1"
  89         android:layout_below="@id/drag_dot_3"
  90         android:layout_alignLeft="@id/drag_dot_3"
Note: This issue has an associated quickfix operation in Eclipse/ADT Fix
Priority: 6 / 10
Category: Performance
Severity: Warning
Explanation: Looks for layout params that are not valid for the given parent layout.
The given layout_param is not defined for the given layout, meaning it has no effect. This usually happens when you change the parent layout or move view code around without updating the layout params. This will cause useless attribute processing at runtime, and is misleading for others reading the layout so the parameter should be removed.

More info:

To suppress this error, use the issue id "ObsoleteLayoutParam" as explained in the Suppressing Warnings and Errors section.
UseCompoundDrawables: Node can be replaced by a TextView with compound drawables
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/incoming_message_info.xml:17: This tag and its children can be replaced by one <TextView/> and a compound drawable
  14      limitations under the License.
  15 -->
  16 
  17 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  18     android:orientation="horizontal"
  19     android:layout_width="match_parent"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/incoming_message_info.xml:17: This tag and its children can be replaced by one <TextView/> and a compound drawable
  14      limitations under the License.
  15 -->
  16 
  17 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  18     android:orientation="horizontal"
  19     android:layout_width="match_parent"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/incoming_message_panel.xml:22: This tag and its children can be replaced by one <TextView/> and a compound drawable
  19     android:layout_height="wrap_content"
  20     android:background="@android:drawable/toast_frame">
  21 
  22     <LinearLayout
  23         android:orientation="horizontal"
  24         android:layout_width="match_parent"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/incoming_message_panel.xml:22: This tag and its children can be replaced by one <TextView/> and a compound drawable
  19     android:layout_height="wrap_content"
  20     android:background="@android:drawable/toast_frame">
  21 
  22     <LinearLayout
  23         android:orientation="horizontal"
  24         android:layout_width="match_parent"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/list_item_icon_text.xml:17: This tag and its children can be replaced by one <TextView/> and a compound drawable
  14      limitations under the License.
  15 -->
  16 
  17 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  18     android:orientation="horizontal"
  19     android:layout_width="match_parent"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/list_item_icon_text.xml:17: This tag and its children can be replaced by one <TextView/> and a compound drawable
  14      limitations under the License.
  15 -->
  16 
  17 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  18     android:orientation="horizontal"
  19     android:layout_width="match_parent"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/status_bar_balloon.xml:17: This tag and its children can be replaced by one <TextView/> and a compound drawable
  14      limitations under the License.
  15 -->
  16 
  17 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  18     android:orientation="horizontal"
  19     android:baselineAligned="false"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/status_bar_balloon.xml:17: This tag and its children can be replaced by one <TextView/> and a compound drawable
  14      limitations under the License.
  15 -->
  16 
  17 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  18     android:orientation="horizontal"
  19     android:baselineAligned="false"
Note: This issue has an associated quickfix operation in Eclipse/ADT Fix
Priority: 6 / 10
Category: Performance
Severity: Warning
Explanation: Checks whether the current node can be replaced by a TextView using compound drawables.
A LinearLayout which contains an ImageView and a TextView can be more efficiently handled as a compound drawable (a single TextView, using the drawableTop, drawableLeft, drawableRight and/or drawableBottom attributes to draw one or more images adjacent to the text).

If the two widgets are offset from each other with margins, this can be replaced with a drawablePadding attribute.

There's a lint quickfix to perform this conversion in the Eclipse plugin.

More info:

To suppress this error, use the issue id "UseCompoundDrawables" as explained in the Suppressing Warnings and Errors section.
HandlerLeak: Handler reference leaks
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/AlertDialogSamples.java:409: This Handler class should be static or leaks might occur (com.example.android.apis.app.AlertDialogSamples.36)
 406             }
 407         });
 408         
 409         mProgressHandler = new Handler() {
 410             @Override
 411             public void handleMessage(Message msg) {
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/AlertDialogSamples.java:409: This Handler class should be static or leaks might occur (com.example.android.apis.app.AlertDialogSamples.36)
 406             }
 407         });
 408         
 409         mProgressHandler = new Handler() {
 410             @Override
 411             public void handleMessage(Message msg) {
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/accessibility/ClockBackService.java:224: This Handler class should be static or leaks might occur (com.example.android.apis.accessibility.ClockBackService.1)
 221     private boolean isInfrastructureInitialized;
 222 
 223     /** {@link Handler} for executing messages on the service main thread. */
 224     Handler mHandler = new Handler() {
 225         @Override
 226         public void handleMessage(Message message) {
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/accessibility/ClockBackService.java:224: This Handler class should be static or leaks might occur (com.example.android.apis.accessibility.ClockBackService.1)
 221     private boolean isInfrastructureInitialized;
 222 
 223     /** {@link Handler} for executing messages on the service main thread. */
 224     Handler mHandler = new Handler() {
 225         @Override
 226         public void handleMessage(Message message) {
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/app/MessengerService.java:84: This Handler class should be static or leaks might occur (com.example.android.apis.app.MessengerService.IncomingHandler)
  81     /**
  82      * Handler of incoming messages from clients.
  83      */
  84     class IncomingHandler extends Handler {
  85         @Override
  86         public void handleMessage(Message msg) {
Priority: 4 / 10
Category: Performance
Severity: Warning
Explanation: Ensures that Handler classes do not hold on to a reference to an outer class.
Since this Handler is declared as an inner class, it may prevent the outer class from being garbage collected. If the Handler is using a Looper or MessageQueue for a thread other than the main thread, then there is no issue. If the Handler is using the Looper or MessageQueue of the main thread, you need to fix your Handler declaration, as follows: Declare the Handler as a static class; In the outer class, instantiate a WeakReference to the outer class and pass this object to your Handler when you instantiate the Handler; Make all references to members of the outer class using the WeakReference object.

More info:

To suppress this error, use the issue id "HandlerLeak" as explained in the Suppressing Warnings and Errors section.
MergeRootFrame: FrameLayout can be replaced with <merge> tag
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/animations_main_screen.xml:17: This <FrameLayout> can be replaced with a <merge> tag
  14      limitations under the License.
  15 -->
  16 
  17 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  18     android:id="@+id/container"
  19     android:layout_width="match_parent"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/animations_main_screen.xml:17: This <FrameLayout> can be replaced with a <merge> tag
  14      limitations under the License.
  15 -->
  16 
  17 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  18     android:id="@+id/container"
  19     android:layout_width="match_parent"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/content_browser.xml:17: This <FrameLayout> can be replaced with a <merge> tag
  14      limitations under the License.
  15 -->
  16 
  17 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  18     android:layout_width="match_parent" android:layout_height="match_parent"
  19     >
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/content_browser.xml:17: This <FrameLayout> can be replaced with a <merge> tag
  14      limitations under the License.
  15 -->
  16 
  17 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  18     android:layout_width="match_parent" android:layout_height="match_parent"
  19     >
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/content_browser_nav.xml:17: This <FrameLayout> can be replaced with a <merge> tag
  14      limitations under the License.
  15 -->
  16 
  17 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  18     android:layout_width="match_parent" android:layout_height="match_parent"
  19     >
Priority: 4 / 10
Category: Performance
Severity: Warning
Explanation: Checks whether a root <FrameLayout> can be replaced with a <merge> tag.
If a <FrameLayout> is the root of a layout and does not provide background or padding etc, it can often be replaced with a <merge> tag which is slightly more efficient. Note that this depends on context, so make sure you understand how the <merge> tag works before proceeding.

More info: http://android-developers.blogspot.com/2009/03/android-layout-tricks-3-optimize-by.html

To suppress this error, use the issue id "MergeRootFrame" as explained in the Suppressing Warnings and Errors section.
UseSparseArrays: HashMap can be replaced with SparseArray
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/accessibility/ClockBackService.java:170: Use new SparseIntArray(...) instead for better performance
 167     }
 168 
 169     /** Mapping from integers to raw sound resource ids. */
 170     private static SparseArray<Integer> sSoundsResourceIds = new SparseArray<Integer>();
 171     static {
 172         sSoundsResourceIds.put(AccessibilityEvent.TYPE_VIEW_CLICKED,
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/accessibility/ClockBackService.java:170: Use new SparseIntArray(...) instead for better performance
 167     }
 168 
 169     /** Mapping from integers to raw sound resource ids. */
 170     private static SparseArray<Integer> sSoundsResourceIds = new SparseArray<Integer>();
 171     static {
 172         sSoundsResourceIds.put(AccessibilityEvent.TYPE_VIEW_CLICKED,
Priority: 4 / 10
Category: Performance
Severity: Warning
Explanation: Looks for opportunities to replace HashMaps with the more efficient SparseArray.
For maps where the keys are of type integer, it's typically more efficient to use the Android SparseArray API. This check identifies scenarios where you might want to consider using SparseArray instead of HashMap for better performance.

This is particularly useful when the value types are primitives like ints, where you can use SparseIntArray and avoid auto-boxing the values from int to Integer.

If you need to construct a HashMap because you need to call an API outside of your control which requires a Map, you can suppress this warning using for example the @SuppressLint annotation.

More info:

To suppress this error, use the issue id "UseSparseArrays" as explained in the Suppressing Warnings and Errors section.
DisableBaselineAlignment: Missing baselineAligned attribute
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/fragment_arguments.xml:35: Set android:baselineAligned="false" on this element for better performance
  32             android:textAppearance="?android:attr/textAppearanceMedium"
  33             android:text="@string/fragment_arguments_msg" />
  34 
  35     <LinearLayout android:orientation="horizontal" android:padding="4dip"
  36         android:layout_width="match_parent" android:layout_height="wrap_content">
  37 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/fragment_arguments.xml:35: Set android:baselineAligned="false" on this element for better performance
  32             android:textAppearance="?android:attr/textAppearanceMedium"
  33             android:text="@string/fragment_arguments_msg" />
  34 
  35     <LinearLayout android:orientation="horizontal" android:padding="4dip"
  36         android:layout_width="match_parent" android:layout_height="wrap_content">
  37 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/fragment_arguments.xml:35: Set android:baselineAligned="false" on this element for better performance
  32             android:textAppearance="?android:attr/textAppearanceMedium"
  33             android:text="@string/fragment_arguments_msg" />
  34 
  35     <LinearLayout android:orientation="horizontal" android:padding="4dip"
  36         android:layout_width="match_parent" android:layout_height="wrap_content">
  37 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/fragment_arguments.xml:35: Set android:baselineAligned="false" on this element for better performance
  32             android:textAppearance="?android:attr/textAppearanceMedium"
  33             android:text="@string/fragment_arguments_msg" />
  34 
  35     <LinearLayout android:orientation="horizontal" android:padding="4dip"
  36         android:layout_width="match_parent" android:layout_height="wrap_content">
  37 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/fragment_arguments_fragment.xml:33: Set android:baselineAligned="false" on this element for better performance
  30             android:textAppearance="?android:attr/textAppearanceMedium"
  31             android:text="@string/fragment_arguments_fragment_msg" />
  32 
  33     <LinearLayout android:orientation="horizontal" android:padding="4dip"
  34         android:layout_width="match_parent" android:layout_height="wrap_content">
  35 
Note: This issue has an associated quickfix operation in Eclipse/ADT Fix
Priority: 3 / 10
Category: Performance
Severity: Warning
Explanation: Looks for LinearLayouts which should set android:baselineAligned=false.
When a LinearLayout is used to distribute the space proportionally between nested layouts, the baseline alignment property should be turned off to make the layout computation faster.

More info:

To suppress this error, use the issue id "DisableBaselineAlignment" as explained in the Suppressing Warnings and Errors section.
InefficientWeight: Inefficient layout weight
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/activity_animation.xml:25: Use a layout_height of 0dip instead of wrap_content for better performance
  22     android:layout_width="match_parent" android:layout_height="match_parent">
  23 
  24     <TextView
  25         android:layout_width="match_parent" android:layout_height="wrap_content"
  26         android:layout_weight="0" android:paddingBottom="4dip"
  27         android:textAppearance="?android:attr/textAppearanceMedium"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/activity_animation.xml:25: Use a layout_height of 0dip instead of wrap_content for better performance
  22     android:layout_width="match_parent" android:layout_height="match_parent">
  23 
  24     <TextView
  25         android:layout_width="match_parent" android:layout_height="wrap_content"
  26         android:layout_weight="0" android:paddingBottom="4dip"
  27         android:textAppearance="?android:attr/textAppearanceMedium"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/activity_recreate.xml:23: Use a layout_height of 0dip instead of wrap_content for better performance
  20     android:layout_width="match_parent" android:layout_height="match_parent">
  21 
  22     <TextView
  23         android:layout_width="match_parent" android:layout_height="wrap_content"
  24         android:layout_weight="0" android:paddingBottom="4dip"
  25         android:textAppearance="?android:attr/textAppearanceMedium"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/activity_recreate.xml:23: Use a layout_height of 0dip instead of wrap_content for better performance
  20     android:layout_width="match_parent" android:layout_height="match_parent">
  21 
  22     <TextView
  23         android:layout_width="match_parent" android:layout_height="wrap_content"
  24         android:layout_weight="0" android:paddingBottom="4dip"
  25         android:textAppearance="?android:attr/textAppearanceMedium"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/alarm_controller.xml:25: Use a layout_height of 0dip instead of wrap_content for better performance
  22     android:layout_width="match_parent" android:layout_height="match_parent">
  23 
  24     <TextView
  25         android:layout_width="match_parent" android:layout_height="wrap_content"
  26         android:layout_weight="0" android:paddingBottom="4dip"
  27         android:textAppearance="?android:attr/textAppearanceMedium"
Note: This issue has an associated quickfix operation in Eclipse/ADT Fix
Priority: 3 / 10
Category: Performance
Severity: Warning
Explanation: Looks for inefficient weight declarations in LinearLayouts.
When only a single widget in a LinearLayout defines a weight, it is more efficient to assign a width/height of 0dp to it since it will absorb all the remaining space anyway. With a declared width/height of 0dp it does not have to measure its own size first.

More info:

To suppress this error, use the issue id "InefficientWeight" as explained in the Suppressing Warnings and Errors section.
NestedWeights: Nested layout weights
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/fragment_hide_show.xml:38: Nested weights are bad for performance
  35             android:text="Hide" />
  36 
  37         <fragment android:name="com.example.android.apis.app.FragmentHideShow$FirstFragment"
  38                 android:id="@+id/fragment1" android:layout_weight="1"
  39                 android:layout_width="0px" android:layout_height="wrap_content" />
  40 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/fragment_hide_show.xml:38: Nested weights are bad for performance
  35             android:text="Hide" />
  36 
  37         <fragment android:name="com.example.android.apis.app.FragmentHideShow$FirstFragment"
  38                 android:id="@+id/fragment1" android:layout_weight="1"
  39                 android:layout_width="0px" android:layout_height="wrap_content" />
  40 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/fragment_hide_show.xml:52: Nested weights are bad for performance
  49             android:text="Hide" />
  50 
  51         <fragment android:name="com.example.android.apis.app.FragmentHideShow$SecondFragment"
  52                 android:id="@+id/fragment2" android:layout_weight="1"
  53                 android:layout_width="0px" android:layout_height="wrap_content" />
  54 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/fragment_hide_show.xml:52: Nested weights are bad for performance
  49             android:text="Hide" />
  50 
  51         <fragment android:name="com.example.android.apis.app.FragmentHideShow$SecondFragment"
  52                 android:id="@+id/fragment2" android:layout_weight="1"
  53                 android:layout_width="0px" android:layout_height="wrap_content" />
  54 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/fragment_stack.xml:42: Nested weights are bad for performance
  39         </Button>
  40         <Button android:id="@+id/delete_fragment"
  41             android:layout_width="wrap_content" android:layout_height="wrap_content"
  42             android:layout_weight="0" 
  43             android:text="@string/delete_fragment">
  44         </Button>
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/fragment_stack.xml:42: Nested weights are bad for performance
  39         </Button>
  40         <Button android:id="@+id/delete_fragment"
  41             android:layout_width="wrap_content" android:layout_height="wrap_content"
  42             android:layout_weight="0" 
  43             android:text="@string/delete_fragment">
  44         </Button>
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/game_controller_input.xml:40: Nested weights are bad for performance
  37             android:id="@+id/summary"
  38             android:layout_width="0dip"
  39             android:layout_height="match_parent"
  40             android:layout_weight="1"
  41             android:padding="3dip">
  42         </ListView>
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/game_controller_input.xml:40: Nested weights are bad for performance
  37             android:id="@+id/summary"
  38             android:layout_width="0dip"
  39             android:layout_height="match_parent"
  40             android:layout_weight="1"
  41             android:padding="3dip">
  42         </ListView>
Priority: 3 / 10
Category: Performance
Severity: Warning
Explanation: Looks for nested layout weights, which are costly.
Layout weights require a widget to be measured twice. When a LinearLayout with non-zero weights is nested inside another LinearLayout with non-zero weights, then the number of measurements increase exponentially.

More info:

To suppress this error, use the issue id "NestedWeights" as explained in the Suppressing Warnings and Errors section.
Overdraw: Overdraw: Painting regions more than once
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/action_bar_settings_action_provider.xml:23: Possible overdraw: Root element paints background ?android:attr/actionBarItemBackground with a theme that also paints a background (inferred theme is @android:style/Theme.Holo)
  20     android:layout_gravity="center"
  21     android:focusable="true"
  22     android:addStatesFromChildren="true"
  23     android:background="?android:attr/actionBarItemBackground"
  24     style="?android:attr/actionButtonStyle">
  25 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/action_bar_settings_action_provider.xml:23: Possible overdraw: Root element paints background ?android:attr/actionBarItemBackground with a theme that also paints a background (inferred theme is @android:style/Theme.Holo)
  20     android:layout_gravity="center"
  21     android:focusable="true"
  22     android:addStatesFromChildren="true"
  23     android:background="?android:attr/actionBarItemBackground"
  24     style="?android:attr/actionButtonStyle">
  25 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/appwidget_provider.xml:21: Possible overdraw: Root element paints background #ffff00ff with a theme that also paints a background (inferred theme is @android:style/Theme.Holo)
  18     android:id="@+id/appwidget_text"
  19     android:layout_width="wrap_content"
  20     android:layout_height="wrap_content"
  21     android:background="#ffff00ff"
  22     android:textColor="#ff000000"
  23 />
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/appwidget_provider.xml:21: Possible overdraw: Root element paints background #ffff00ff with a theme that also paints a background (inferred theme is @android:style/Theme.Holo)
  18     android:id="@+id/appwidget_text"
  19     android:layout_width="wrap_content"
  20     android:layout_height="wrap_content"
  21     android:background="#ffff00ff"
  22     android:textColor="#ff000000"
  23 />
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/grid_layout_1.xml:26: Possible overdraw: Root element paints background @drawable/blue with a theme that also paints a background (inferred theme is @android:style/Theme.Holo)
  23     xmlns:android="http://schemas.android.com/apk/res/android"
  24     android:layout_width="match_parent"
  25     android:layout_height="wrap_content"
  26     android:background="@drawable/blue"
  27     android:columnCount="4"
  28     android:padding="10dip"
Priority: 3 / 10
Category: Performance
Severity: Warning
Explanation: Looks for overdraw issues (where a view is painted only to be fully painted over)
If you set a background drawable on a root view, then you should use a custom theme where the theme background is null. Otherwise, the theme background will be painted first, only to have your custom background completely cover it; this is called "overdraw".

NOTE: This detector relies on figuring out which layouts are associated with which activities based on scanning the Java code, and it's currently doing that using an inexact pattern matching algorithm. Therefore, it can incorrectly conclude which activity the layout is associated with and then wrongly complain that a background-theme is hidden.

If you want your custom background on multiple pages, then you should consider making a custom theme with your custom background and just using that theme instead of a root element background.

Of course it's possible that your custom drawable is translucent and you want it to be mixed with the background. However, you will get better performance if you pre-mix the background with your drawable and use that resulting image or color as a custom theme background instead.

More info:

To suppress this error, use the issue id "Overdraw" as explained in the Suppressing Warnings and Errors section.
UnusedResources: Unused resources
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/animation_custom_evaluator.xml: The resource R.layout.animation_custom_evaluator appears to be unused
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/animation_custom_evaluator.xml: The resource R.layout.animation_custom_evaluator appears to be unused
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable/circular_progress.xml: The resource R.drawable.circular_progress appears to be unused
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable/circular_progress.xml: The resource R.drawable.circular_progress appears to be unused
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/values/colors.xml:28: The resource R.color.solid_blue appears to be unused
  25     <drawable name="transparent_background">#00000000</drawable>
  26 
  27     <color name="solid_red">#f00</color>
  28     <color name="solid_blue">#0000ff</color>
  29     <color name="solid_green">#f0f0</color>
  30     <color name="solid_yellow">#ffffff00</color>
Priority: 3 / 10
Category: Performance
Severity: Warning
Explanation: Looks for unused resources.
Unused resources make applications larger and slow down builds.

More info:

To suppress this error, use the issue id "UnusedResources" as explained in the Suppressing Warnings and Errors section.
UselessParent: Useless parent layout
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/animation_reversing.xml:22: This LinearLayout layout or its LinearLayout parent is useless
  19     android:layout_height="match_parent"
  20     android:id="@+id/container"
  21     >
  22     <LinearLayout
  23         android:orientation="horizontal"
  24         android:layout_width="match_parent"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/animation_reversing.xml:22: This LinearLayout layout or its LinearLayout parent is useless
  19     android:layout_height="match_parent"
  20     android:id="@+id/container"
  21     >
  22     <LinearLayout
  23         android:orientation="horizontal"
  24         android:layout_width="match_parent"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/animation_seeking.xml:22: This LinearLayout layout or its LinearLayout parent is useless
  19     android:layout_height="match_parent"
  20     android:id="@+id/container"
  21     >
  22     <LinearLayout
  23         android:orientation="horizontal"
  24         android:layout_width="match_parent"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/animation_seeking.xml:22: This LinearLayout layout or its LinearLayout parent is useless
  19     android:layout_height="match_parent"
  20     android:id="@+id/container"
  21     >
  22     <LinearLayout
  23         android:orientation="horizontal"
  24         android:layout_width="match_parent"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/animator_custom_evaluator.xml:22: This LinearLayout layout or its LinearLayout parent is useless
  19     android:layout_height="match_parent"
  20     android:id="@+id/container"
  21     >
  22     <LinearLayout
  23         android:orientation="horizontal"
  24         android:layout_width="match_parent"
Note: This issue has an associated quickfix operation in Eclipse/ADT Fix
Priority: 2 / 10
Category: Performance
Severity: Warning
Explanation: Checks whether a parent layout can be removed.
A layout with children that has no siblings, is not a scrollview or a root layout, and does not have a background, can be removed and have its children moved directly into the parent for a flatter and more efficient layout hierarchy.

More info:

To suppress this error, use the issue id "UselessParent" as explained in the Suppressing Warnings and Errors section.
Usability:Typography
TypographyEllipsis: Ellipsis string can be replaced with ellipsis character
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/values/arrays.xml:136: Replace "..." with ellipsis character (…, &#8230;) ?
 133         <item>*bzzt*\nSending all life savings to the International Cabal of Evil Penguins.</item>
 134         <item>*bzzt*\nOpening portal to R\'lyeh.  Long live Cthulhu!</item>
 135         <item>*bzzt*\nYou\'re not very good at this, are you?</item>
 136         <item>*bzzt*\nGo away...</item>
 137     </string-array>
 138 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/values/arrays.xml:136: Replace "..." with ellipsis character (…, &#8230;) ?
 133         <item>*bzzt*\nSending all life savings to the International Cabal of Evil Penguins.</item>
 134         <item>*bzzt*\nOpening portal to R\'lyeh.  Long live Cthulhu!</item>
 135         <item>*bzzt*\nYou\'re not very good at this, are you?</item>
 136         <item>*bzzt*\nGo away...</item>
 137     </string-array>
 138 
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/values/arrays.xml:151: Replace "..." with ellipsis character (…, &#8230;) ?
 148         <item>Yes, sir.  It\'s, ah ..... it\'s a bit runny.</item>
 149         <item>Well, it\'s very runny, actually, sir.</item>
 150         <item>I think it\'s a bit runnier than you\'ll like it, sir.</item>
 151         <item>Oh... The cat\'s eaten it.</item>
 152         <item>No.</item>
 153         <item>No.</item>
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/values/arrays.xml:151: Replace "..." with ellipsis character (…, &#8230;) ?
 148         <item>Yes, sir.  It\'s, ah ..... it\'s a bit runny.</item>
 149         <item>Well, it\'s very runny, actually, sir.</item>
 150         <item>I think it\'s a bit runnier than you\'ll like it, sir.</item>
 151         <item>Oh... The cat\'s eaten it.</item>
 152         <item>No.</item>
 153         <item>No.</item>
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/values/arrays.xml:155: Replace "..." with ellipsis character (…, &#8230;) ?
 152         <item>No.</item>
 153         <item>No.</item>
 154         <item>No.</item>
 155         <item>Mmm... cheese.</item>
 156     </string-array>
 157 
Note: This issue has an associated quickfix operation in Eclipse/ADT Fix
Priority: 5 / 10
Category: Usability:Typography
Severity: Warning
Explanation: Looks for ellipsis strings (...) which can be replaced with an ellipsis character.
You can replace the string "..." with a dedicated ellipsis character, ellipsis character (…, &#8230;). This can help make the text more readable.

More info: http://en.wikipedia.org/wiki/Ellipsis

To suppress this error, use the issue id "TypographyEllipsis" as explained in the Suppressing Warnings and Errors section.
Usability:Icons
GifUsage: Using .gif format for bitmaps is discouraged
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable/animated_gif.gif: Using the .gif format for bitmaps is discouraged
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable/animated_gif.gif: Using the .gif format for bitmaps is discouraged
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable/frog.gif: Using the .gif format for bitmaps is discouraged
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable/frog.gif: Using the .gif format for bitmaps is discouraged
Priority: 5 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Checks for images using the GIF file format which is discouraged.
The .gif file format is discouraged. Consider using .png (preferred) or .jpg (acceptable) instead.

More info: http://developer.android.com/guide/topics/resources/drawable-resource.html#Bitmap

To suppress this error, use the issue id "GifUsage" as explained in the Suppressing Warnings and Errors section.
IconLocation: Image defined in density-independent drawable folder
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable/animated_gif.gif: Found bitmap drawable res/drawable/animated_gif.gif in densityless folder
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable/animated_gif.gif: Found bitmap drawable res/drawable/animated_gif.gif in densityless folder
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable/balloons.jpg: Found bitmap drawable res/drawable/balloons.jpg in densityless folder
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable/balloons.jpg: Found bitmap drawable res/drawable/balloons.jpg in densityless folder
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable/beach.jpg: Found bitmap drawable res/drawable/beach.jpg in densityless folder
Priority: 5 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Ensures that images are not defined in the density-independent drawable folder.
The res/drawable folder is intended for density-independent graphics such as shapes defined in XML. For bitmaps, move it to drawable-mdpi and consider providing higher and lower resolution versions in drawable-ldpi, drawable-hdpi and drawable-xhdpi. If the icon really is density independent (for example a solid color) you can place it in drawable-nodpi.

More info: http://developer.android.com/guide/practices/screens_support.html

To suppress this error, use the issue id "IconLocation" as explained in the Suppressing Warnings and Errors section.
IconDensities: Icon densities validation
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable-hdpi: Missing the following drawables in drawable-hdpi: ic_settings_applications.png, ic_settings_display.png
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable-hdpi: Missing the following drawables in drawable-hdpi: ic_settings_applications.png, ic_settings_display.png
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable-mdpi: Missing the following drawables in drawable-mdpi: logo240dpi.png, npatch240dpi.9.png, reslogo240dpi.png, smlnpatch240dpi.9.png, stylogo240dpi.png
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable-mdpi: Missing the following drawables in drawable-mdpi: logo240dpi.png, npatch240dpi.9.png, reslogo240dpi.png, smlnpatch240dpi.9.png, stylogo240dpi.png
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable-xhdpi: Missing the following drawables in drawable-xhdpi: alert_dialog_icon.png, apidemo_androidlogo.png, app_sample_code.png, arrow_down_float.png, arrow_up_float.png... (23 more)
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable-xhdpi: Missing the following drawables in drawable-xhdpi: alert_dialog_icon.png, apidemo_androidlogo.png, app_sample_code.png, arrow_down_float.png, arrow_up_float.png... (23 more)
Priority: 4 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Ensures that icons provide custom versions for all supported densities.
Icons will look best if a custom version is provided for each of the major screen density classes (low, medium, high, extra high). This lint check identifies icons which do not have complete coverage across the densities.

Low density is not really used much anymore, so this check ignores the ldpi density. To force lint to include it, set the environment variable ANDROID_LINT_INCLUDE_LDPI=true. For more information on current density usage, see http://developer.android.com/resources/dashboard/screens.html

More info: http://developer.android.com/guide/practices/screens_support.html

To suppress this error, use the issue id "IconDensities" as explained in the Suppressing Warnings and Errors section.
IconDuplicates: Duplicated icons under different names
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable-nodpi/logonodpi120.png: The following unrelated icon files have identical contents: logo120dpi.png, reslogo120dpi.png, stylogo120dpi.png, logonodpi120.png


ldpildpildpinodpi
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable-nodpi/logonodpi120.png: The following unrelated icon files have identical contents: logo120dpi.png, reslogo120dpi.png, stylogo120dpi.png, logonodpi120.png


ldpildpildpinodpi
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable-nodpi/logonodpi240.png: The following unrelated icon files have identical contents: logo240dpi.png, reslogo240dpi.png, stylogo240dpi.png, logonodpi240.png


hdpihdpihdpinodpi
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable-nodpi/logonodpi240.png: The following unrelated icon files have identical contents: logo240dpi.png, reslogo240dpi.png, stylogo240dpi.png, logonodpi240.png


hdpihdpihdpinodpi
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable/stylogo160dpi.png: The following unrelated icon files have identical contents: logonodpi160.png, logo160dpi.png, reslogo160dpi.png, stylogo160dpi.png


nodpi
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/drawable/stylogo160dpi.png: The following unrelated icon files have identical contents: logonodpi160.png, logo160dpi.png, reslogo160dpi.png, stylogo160dpi.png


nodpi
Priority: 3 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Finds duplicated icons under different names.
If an icon is repeated under different names, you can consolidate and just use one of the icons and delete the others to make your application smaller. However, duplicated icons usually are not intentional and can sometimes point to icons that were accidentally overwritten or accidentally not updated.

More info:

To suppress this error, use the issue id "IconDuplicates" as explained in the Suppressing Warnings and Errors section.
Usability
ButtonOrder: Button order
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/animator_events.xml:33: Layout uses the wrong button order for API >= 14: Create a layout-v14/animator_events.xml file with opposite order: Cancel button should be on the left (was "Play | Cancel | End", should be "Cancel | Play | End")
  30             android:text="Play"
  31             android:id="@+id/startButton"
  32             />
  33         <Button
  34             android:layout_width="wrap_content"
  35             android:layout_height="wrap_content"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/animator_events.xml:33: Layout uses the wrong button order for API >= 14: Create a layout-v14/animator_events.xml file with opposite order: Cancel button should be on the left (was "Play | Cancel | End", should be "Cancel | Play | End")
  30             android:text="Play"
  31             android:id="@+id/startButton"
  32             />
  33         <Button
  34             android:layout_width="wrap_content"
  35             android:layout_height="wrap_content"
Priority: 8 / 10
Category: Usability
Severity: Warning
Explanation: Ensures the dismissive action of a dialog is on the left and affirmative on the right.
According to the Android Design Guide,

"Action buttons are typically Cancel and/or OK, with OK indicating the preferred or most likely action. However, if the options consist of specific actions such as Close or Wait rather than a confirmation or cancellation of the action described in the content, then all the buttons should be active verbs. As a rule, the dismissive action of a dialog is always on the left whereas the affirmative actions are on the right."

This check looks for button bars and buttons which look like cancel buttons, and makes sure that these are on the left.

More info: http://developer.android.com/design/building-blocks/dialogs.html

To suppress this error, use the issue id "ButtonOrder" as explained in the Suppressing Warnings and Errors section.
TextFields: Missing inputType or hint
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/alert_dialog_text_entry.xml:32: This text field does not specify an inputType or a hint
  29         android:gravity="left"
  30         android:textAppearance="?android:attr/textAppearanceMedium" />
  31             
  32     <EditText
  33         android:id="@+id/username_edit"
  34         android:layout_height="wrap_content"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/alert_dialog_text_entry.xml:32: This text field does not specify an inputType or a hint
  29         android:gravity="left"
  30         android:textAppearance="?android:attr/textAppearanceMedium" />
  31             
  32     <EditText
  33         android:id="@+id/username_edit"
  34         android:layout_height="wrap_content"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/alert_dialog_text_entry.xml:54: This text field does not specify an inputType or a hint
  51         android:gravity="left"
  52         android:textAppearance="?android:attr/textAppearanceMedium" />
  53             
  54     <EditText
  55         android:id="@+id/password_edit"
  56         android:layout_height="wrap_content"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/alert_dialog_text_entry.xml:54: This text field does not specify an inputType or a hint
  51         android:gravity="left"
  52         android:textAppearance="?android:attr/textAppearanceMedium" />
  53             
  54     <EditText
  55         android:id="@+id/password_edit"
  56         android:layout_height="wrap_content"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/animation_1.xml:30: This text field does not specify an inputType or a hint
  27         android:text="@string/animation_1_instructions"
  28     />
  29     
  30     <EditText android:id="@+id/pw"
  31         android:layout_width="match_parent"
  32         android:layout_height="wrap_content"
Note: This issue has an associated quickfix operation in Eclipse/ADT Fix
Priority: 5 / 10
Category: Usability
Severity: Warning
Explanation: Looks for text fields missing inputType or hint settings.
Providing an inputType attribute on a text field improves usability because depending on the data to be input, optimized keyboards can be shown to the user (such as just digits and parentheses for a phone number). Similarly,a hint attribute displays a hint to the user for what is expected in the text field.

The lint detector also looks at the id of the view, and if the id offers a hint of the purpose of the field (for example, the id contains the phrase phone or email), then lint will also ensure that the inputType contains the corresponding type attributes.

If you really want to keep the text field generic, you can suppress this warning by setting inputType="text".

More info:

To suppress this error, use the issue id "TextFields" as explained in the Suppressing Warnings and Errors section.
AlwaysShowAction: Usage of showAsAction=always
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/menu/action_bar_share_action_provider.xml:19: Prefer "ifRoom" instead of "always"
  16 <menu xmlns:android="http://schemas.android.com/apk/res/android">
  17 
  18     <item android:id="@+id/menu_item_share_action_provider_action_bar"
  19         android:showAsAction="always"
  20         android:title="@string/action_bar_share_with"
  21         android:actionProviderClass="android.widget.ShareActionProvider" />
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/menu/action_bar_share_action_provider.xml:19: Prefer "ifRoom" instead of "always"
  16 <menu xmlns:android="http://schemas.android.com/apk/res/android">
  17 
  18     <item android:id="@+id/menu_item_share_action_provider_action_bar"
  19         android:showAsAction="always"
  20         android:title="@string/action_bar_share_with"
  21         android:actionProviderClass="android.widget.ShareActionProvider" />
Priority: 3 / 10
Category: Usability
Severity: Warning
Explanation: Checks for uses of showAsAction="always" and suggests showAsAction="ifRoom" instead.
Using showAsAction="always" in menu XML, or MenuItem.SHOW_AS_ACTION_ALWAYS in Java code is usually a deviation from the user interface style guide.Use ifRoom or the corresponding MenuItem.SHOW_AS_ACTION_IF_ROOM instead.

If always is used sparingly there are usually no problems and behavior is roughly equivalent to ifRoom but with preference over other ifRoom items. Using it more than twice in the same menu is a bad idea.

This check looks for menu XML files that contain more than two always actions, or some always actions and no ifRoom actions. In Java code, it looks for projects that contain references to MenuItem.SHOW_AS_ACTION_ALWAYS and no references to MenuItem.SHOW_AS_ACTION_IF_ROOM.

More info: http://developer.android.com/design/patterns/actionbar.html

To suppress this error, use the issue id "AlwaysShowAction" as explained in the Suppressing Warnings and Errors section.
ViewConstructor: Missing View constructors for XML inflation
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/graphics/PurgeableBitmapView.java: Custom view com/example/android/apis/graphics/PurgeableBitmapView is missing constructor used by tools: (Context) or (Context,AttributeSet) or (Context,AttributeSet,int)
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/java/com/example/android/apis/graphics/PurgeableBitmapView.java: Custom view com/example/android/apis/graphics/PurgeableBitmapView is missing constructor used by tools: (Context) or (Context,AttributeSet) or (Context,AttributeSet,int)
Priority: 3 / 10
Category: Usability
Severity: Warning
Explanation: Checks that custom views define the expected constructors.
Some layout tools (such as the Android layout editor for Eclipse) needs to find a constructor with one of the following signatures:
* View(Context context)
* View(Context context, AttributeSet attrs)
* View(Context context, AttributeSet attrs, int defStyle)

If your custom view needs to perform initialization which does not apply when used in a layout editor, you can surround the given code with a check to see if View#isInEditMode() is false, since that method will return false at runtime but true within a user interface editor.

More info:

To suppress this error, use the issue id "ViewConstructor" as explained in the Suppressing Warnings and Errors section.
ButtonCase: Cancel/OK dialog button capitalization
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/values/strings.xml:1121: The standard Android way to capitalize Ok is "OK" (tip: use @android:string/ok instead)
1118     <string name="focus_5_button5">5</string>
1119     <string name="gallery_2_text">Testing</string>
1120     <string name="grid_layout_1_instructions">Type here:</string>
1121     <string name="grid_layout_1_ok">Ok</string>
1122     <string name="grid_layout_1_cancel">Cancel</string>
1123     <string name="googlelogin_login">Login</string>
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/values/strings.xml:1121: The standard Android way to capitalize Ok is "OK" (tip: use @android:string/ok instead)
1118     <string name="focus_5_button5">5</string>
1119     <string name="gallery_2_text">Testing</string>
1120     <string name="grid_layout_1_instructions">Type here:</string>
1121     <string name="grid_layout_1_ok">Ok</string>
1122     <string name="grid_layout_1_cancel">Cancel</string>
1123     <string name="googlelogin_login">Login</string>
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/values/strings.xml:1195: The standard Android way to capitalize Ok is "OK" (tip: use @android:string/ok instead)
1192     <string name="relative_layout_1_bottom">Bottom</string>
1193     <string name="relative_layout_1_center">center_vertical</string>
1194     <string name="relative_layout_2_instructions">Type here:</string>
1195     <string name="relative_layout_2_ok">Ok</string>
1196     <string name="relative_layout_2_cancel">Cancel</string>
1197     <string name="rotation_animation_description">
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/values/strings.xml:1195: The standard Android way to capitalize Ok is "OK" (tip: use @android:string/ok instead)
1192     <string name="relative_layout_1_bottom">Bottom</string>
1193     <string name="relative_layout_1_center">center_vertical</string>
1194     <string name="relative_layout_2_instructions">Type here:</string>
1195     <string name="relative_layout_2_ok">Ok</string>
1196     <string name="relative_layout_2_cancel">Cancel</string>
1197     <string name="rotation_animation_description">
Priority: 2 / 10
Category: Usability
Severity: Warning
Explanation: Ensures that Cancel/OK dialog buttons use the canonical capitalization.
The standard capitalization for OK/Cancel dialogs is "OK" and "Cancel". To ensure that your dialogs use the standard strings, you can use the resource strings @android:string/ok and @android:string/cancel.

More info:

To suppress this error, use the issue id "ButtonCase" as explained in the Suppressing Warnings and Errors section.
Accessibility
ContentDescription: Image without contentDescription
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/accessibility_service.xml:27: [Accessibility] Missing contentDescription attribute on image
  24         android:text="@string/accessibility_service_instructions"
  25         />
  26 
  27     <ImageButton android:id="@+id/button"
  28         android:background="@drawable/ic_launcher_settings"
  29         android:layout_width="32dip"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/accessibility_service.xml:27: [Accessibility] Missing contentDescription attribute on image
  24         android:text="@string/accessibility_service_instructions"
  25         />
  26 
  27     <ImageButton android:id="@+id/button"
  28         android:background="@drawable/ic_launcher_settings"
  29         android:layout_width="32dip"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/action_bar_settings_action_provider.xml:26: [Accessibility] Missing contentDescription attribute on image
  23     android:background="?android:attr/actionBarItemBackground"
  24     style="?android:attr/actionButtonStyle">
  25 
  26     <ImageButton android:id="@+id/button"
  27         android:background="@drawable/ic_launcher_settings"
  28         android:layout_width="32dip"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/action_bar_settings_action_provider.xml:26: [Accessibility] Missing contentDescription attribute on image
  23     android:background="?android:attr/actionBarItemBackground"
  24     style="?android:attr/actionButtonStyle">
  25 
  26     <ImageButton android:id="@+id/button"
  27         android:background="@drawable/ic_launcher_settings"
  28         android:layout_width="32dip"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/animations_main_screen.xml:29: [Accessibility] Missing contentDescription attribute on image
  26         android:layout_height="match_parent"
  27         android:layoutAnimation="@anim/layout_bottom_to_top_slide" />
  28 
  29     <ImageView
  30         android:id="@+id/picture"
  31         android:scaleType="fitCenter"
Note: This issue has an associated quickfix operation in Eclipse/ADT Fix
Priority: 3 / 10
Category: Accessibility
Severity: Warning
Explanation: Ensures that image widgets provide a contentDescription.
Non-textual widgets like ImageViews and ImageButtons should use the contentDescription attribute to specify a textual description of the widget such that screen readers and other accessibility tools can adequately describe the user interface.

Note that elements in application screens that are purely decorative and do not provide any content or enable a user action should not have accessibility content descriptions. In this case, just suppress the lint warning with a tools:ignore="ContentDescription" attribute.

Note that for text fields, you should not set both the hint and the contentDescription attributes since the hint will never be shown. Just set the hint. See http://developer.android.com/guide/topics/ui/accessibility/checklist.html#special-cases.

More info:

To suppress this error, use the issue id "ContentDescription" as explained in the Suppressing Warnings and Errors section.
Internationalization
HardcodedText: Hardcoded text
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/activity_finish_affinity.xml:26: [I18N] Hardcoded string "No matter how deep you go, Activity.finishAffinity() will get you back.", should use @string resource
  23         android:layout_width="match_parent" android:layout_height="wrap_content"
  24         android:layout_weight="0" android:paddingBottom="4dip"
  25         android:textAppearance="?android:attr/textAppearanceMedium"
  26         android:text="No matter how deep you go, Activity.finishAffinity() will get you back."/>
  27 
  28     <TextView android:id="@+id/seq"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/activity_finish_affinity.xml:26: [I18N] Hardcoded string "No matter how deep you go, Activity.finishAffinity() will get you back.", should use @string resource
  23         android:layout_width="match_parent" android:layout_height="wrap_content"
  24         android:layout_weight="0" android:paddingBottom="4dip"
  25         android:textAppearance="?android:attr/textAppearanceMedium"
  26         android:text="No matter how deep you go, Activity.finishAffinity() will get you back."/>
  27 
  28     <TextView android:id="@+id/seq"
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/activity_finish_affinity.xml:35: [I18N] Hardcoded string "Nest some more", should use @string resource
  32 
  33     <Button android:id="@+id/nest"
  34         android:layout_width="wrap_content" android:layout_height="wrap_content"
  35         android:text="Nest some more">
  36         <requestFocus />
  37     </Button>
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/activity_finish_affinity.xml:35: [I18N] Hardcoded string "Nest some more", should use @string resource
  32 
  33     <Button android:id="@+id/nest"
  34         android:layout_width="wrap_content" android:layout_height="wrap_content"
  35         android:text="Nest some more">
  36         <requestFocus />
  37     </Button>
/Users/a42/Develop/android-project/ApiDemosPlus/app/src/main/res/layout/activity_finish_affinity.xml:41: [I18N] Hardcoded string "FINISH!", should use @string resource
  38 
  39     <Button android:id="@+id/finish"
  40         android:layout_width="wrap_content" android:layout_height="wrap_content"
  41         android:text="FINISH!">
  42         <requestFocus />
  43     </Button>
Note: This issue has an associated quickfix operation in Eclipse/ADT Fix
Priority: 5 / 10
Category: Internationalization
Severity: Warning
Explanation: Looks for hardcoded text attributes which should be converted to resource lookup.
Hardcoding text attributes directly in layout files is bad for several reasons:

* When creating configuration variations (for example for landscape or portrait)you have to repeat the actual text (and keep it up to date when making changes)

* The application cannot be translated to other languages by just adding new translations for existing string resources.

In Eclipse there is a quickfix to automatically extract this hardcoded string into a resource lookup.

More info:

To suppress this error, use the issue id "HardcodedText" as explained in the Suppressing Warnings and Errors section.
Disabled Checks
The following issues were not run by lint, either because the check is not enabled by default, or because it was disabled with a command line flag or via one or more lint.xml configuration files in the project directories.

BackButton
Disabled By: Default
Priority: 6 / 10
Category: Usability
Severity: Warning
Explanation: Looks for Back buttons, which are not common on the Android platform.
According to the Android Design Guide,

"Other platforms use an explicit back button with label to allow the user to navigate up the application's hierarchy. Instead, Android uses the main action bar's app icon for hierarchical navigation and the navigation bar's back button for temporal navigation."
This check is not very sophisticated (it just looks for buttons with the label "Back"), so it is disabled by default to not trigger on common scenarios like pairs of Back/Next buttons to paginate through screens.

More info: http://developer.android.com/design/patterns/pure-android.html

To suppress this error, use the issue id "BackButton" as explained in the Suppressing Warnings and Errors section.
EasterEgg
Disabled By: Default
Priority: 6 / 10
Category: Security
Severity: Warning
Explanation: Looks for hidden easter eggs.
An "easter egg" is code deliberately hidden in the code, both from potential users and even from other developers. This lint check looks for code which looks like it may be hidden from sight.

More info:

To suppress this error, use the issue id "EasterEgg" as explained in the Suppressing Warnings and Errors section.
FieldGetter
Disabled By: Default
Priority: 4 / 10
Category: Performance
Severity: Warning
Explanation: Suggests replacing uses of getters with direct field access within a class.
Accessing a field within the class that defines a getter for that field is at least 3 times faster than calling the getter. For simple getters that do nothing other than return the field, you might want to just reference the local field directly instead.

NOTE: As of Android 2.3 (Gingerbread), this optimization is performed automatically by Dalvik, so there is no need to change your code; this is only relevant if you are targeting older versions of Android.

More info: http://developer.android.com/guide/practices/design/performance.html#internal_get_set

To suppress this error, use the issue id "FieldGetter" as explained in the Suppressing Warnings and Errors section.
IconExpectedSize
Disabled By: Default
Priority: 5 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Ensures that launcher icons, notification icons etc have the correct size.
There are predefined sizes (for each density) for launcher icons. You should follow these conventions to make sure your icons fit in with the overall look of the platform.

More info: http://developer.android.com/design/style/iconography.html

To suppress this error, use the issue id "IconExpectedSize" as explained in the Suppressing Warnings and Errors section.
RtlCompat
Disabled By: Default
Priority: 6 / 10
Category: Bi-directional Text
Severity: Error
Explanation: Looks for compatibility issues with RTL support.
API 17 adds a textAlignment attribute to specify text alignment. However, if you are supporting older versions than API 17, you must also specify a gravity or layout_gravity attribute, since older platforms will ignore the textAlignment attribute.

More info:

To suppress this error, use the issue id "RtlCompat" as explained in the Suppressing Warnings and Errors section.
RtlEnabled
Disabled By: Default
Priority: 3 / 10
Category: Bi-directional Text
Severity: Warning
Explanation: Looks for usages of right-to-left text constants without enabling RTL support.
To enable right-to-left support, when running on API 17 and higher, you must set the android:supportsRtl attribute in the manifest <application> element.
If you have started adding RTL attributes, but have not yet finished the migration, you can set the attribute to false to satisfy this lint check.

More info:

To suppress this error, use the issue id "RtlEnabled" as explained in the Suppressing Warnings and Errors section.
RtlHardcoded
Disabled By: Default
Priority: 5 / 10
Category: Bi-directional Text
Severity: Warning
Explanation: Looks for hardcoded left/right constants which could be start/end for bidirectional text.
Using Gravity#LEFT and Gravity#RIGHT can lead to problems when a layout is rendered in locales where text flows from right to left. Use Gravity#START and Gravity#END instead. Similarly, in XML gravity and layout_gravity attributes, use start rather than left.
For XML attributes such as paddingLeft and layout_marginLeft, use paddingStart and layout_marginStart. NOTE: If your minSdkVersion is less than 17, you should add both the older left/right attributes as well as the new start/right attributes. On older platforms, where RTL is not supported and the start/right attributes are unknown and therefore ignored, you need the older left/right attributes. There is a separate lint check which catches that type of error.
(Note: For Gravity#LEFT and Gravity#START, you can use these constants even when targeting older platforms, because the start bitmask is a superset of the left bitmask. Therefore, you can use gravity="start" rather than gravity="left|start".)

More info:

To suppress this error, use the issue id "RtlHardcoded" as explained in the Suppressing Warnings and Errors section.
SelectableText
Disabled By: Default
Priority: 7 / 10
Category: Usability
Severity: Warning
Explanation: Looks for TextViews which should probably allow their text to be selected.
If a <TextView> is used to display data, the user might want to copy that data and paste it elsewhere. To allow this, the <TextView> should specify android:textIsSelectable="true".

This lint check looks for TextViews which are likely to be displaying data: views whose text is set dynamically. This value will be ignored on platforms older than API 11, so it is okay to set it regardless of your minSdkVersion.

More info:

To suppress this error, use the issue id "SelectableText" as explained in the Suppressing Warnings and Errors section.
StopShip
Disabled By: Default
Priority: 10 / 10
Category: Correctness
Severity: Warning
Explanation: Looks for comment markers of the form //STOPSHIP which indicates that code should not be released yet.
Using the comment // STOPSHIP can be used to flag code that is incomplete but checked in. This comment marker can be used to indicate that the code should not be shipped until the issue is addressed, and lint will look for these.

More info:

To suppress this error, use the issue id "StopShip" as explained in the Suppressing Warnings and Errors section.
TypographyQuotes
Note: This issue has an associated quickfix operation in Eclipse/ADT Fix
Disabled By: Default
Priority: 5 / 10
Category: Usability:Typography
Severity: Warning
Explanation: Looks for straight quotes which can be replaced by curvy quotes.
Straight single quotes and double quotes, when used as a pair, can be replaced by "curvy quotes" (or directional quotes). This can make the text more readable.

Note that you should never use grave accents and apostrophes to quote, `like this'.

(Also note that you should not use curvy quotes for code fragments.)

More info: http://en.wikipedia.org/wiki/Quotation_mark

To suppress this error, use the issue id "TypographyQuotes" as explained in the Suppressing Warnings and Errors section.
UnusedIds
Disabled By: Default
Priority: 1 / 10
Category: Performance
Severity: Warning
Explanation: Looks for unused id's.
This resource id definition appears not to be needed since it is not referenced from anywhere. Having id definitions, even if unused, is not necessarily a bad idea since they make working on layouts and menus easier, so there is not a strong reason to delete these.

More info:

To suppress this error, use the issue id "UnusedIds" as explained in the Suppressing Warnings and Errors section.
Suppressing Warnings and Errors
Lint errors can be suppressed in a variety of ways:

1. With a @SuppressLint annotation in the Java code
2. With a tools:ignore attribute in the XML file
3. With a lint.xml configuration file in the project
4. With a lint.xml configuration file passed to lint via the --config flag
5. With the --ignore flag passed to lint.

To suppress a lint warning with an annotation, add a @SuppressLint("id") annotation on the class, method or variable declaration closest to the warning instance you want to disable. The id can be one or more issue id's, such as "UnusedResources" or {"UnusedResources","UnusedIds"}, or it can be "all" to suppress all lint warnings in the given scope.

To suppress a lint warning in an XML file, add a tools:ignore="id" attribute on the element containing the error, or one of its surrounding elements. You also need to define the namespace for the tools prefix on the root element in your document, next to the xmlns:android declaration:
* xmlns:tools="http://schemas.android.com/tools"

To suppress lint warnings with a configuration XML file, create a file named lint.xml and place it at the root directory of the project in which it applies. (If you use the Eclipse plugin's Lint view, you can suppress errors there via the toolbar and Eclipse will create the lint.xml file for you.).

The format of the lint.xml file is something like the following:

<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Disable this given check in this project -->
<issue id="IconMissingDensityFolder" severity="ignore" />

<!-- Ignore the ObsoleteLayoutParam issue in the given files -->
<issue id="ObsoleteLayoutParam">
<ignore path="res/layout/activation.xml" />
<ignore path="res/layout-xlarge/activation.xml" />
</issue>

<!-- Ignore the UselessLeaf issue in the given file -->
<issue id="UselessLeaf">
<ignore path="res/layout/main.xml" />
</issue>

<!-- Change the severity of hardcoded strings to "error" -->
<issue id="HardcodedText" severity="error" />
</lint>

To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:
"lint --ignore UnusedResources,UselessLeaf /my/project/path"